import 'package:flutter/material.dart';

import '../searches.dart';
class Home extends StatefulWidget {
  Home({Key key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.center,

      children: [
        RaisedButton(
          child: Text('跳转到Search 页面'),
          //点击事件
          onPressed: (){
            ///路由跳转
            Navigator.of(context).push(
              //需要跳转的页面路线
              MaterialPageRoute(
                //执行跳转到那个页面
                  builder: (context)=>Searches(),
              ),
            );
          },
          //配置按钮主题
          color: Theme.of(context).accentColor,
          //配置按钮的文字主题
          textTheme: ButtonTextTheme.primary,
        ),
      ],
    );
  }
}
